home *** CD-ROM | disk | FTP | other *** search
/ CU Amiga Super CD-ROM 19 / CU Amiga Magazine's Super CD-ROM 19 (1998)(EMAP Images)(GB)[!][issue 1998-02].iso / CUCD / Online / NNTPd / server / common.h < prev    next >
Encoding:
C/C++ Source or Header  |  2002-11-17  |  3.6 KB  |  222 lines

  1. /*
  2.  * Common declarations, includes, and other goodies.
  3.  *
  4.  * @(#)$Id: common.h,v 1.42 1994/11/17 16:40:42 sob Exp sob $
  5.  */
  6.  
  7.  
  8. #include "../conf.h"
  9. #include <stdio.h>
  10. #ifndef BSD_42
  11. #include <sys/types.h>
  12. #endif /* BSD_42 */
  13. #include <sys/param.h>
  14. #include <sys/stat.h>
  15. #include <errno.h>
  16. #include <ctype.h>
  17. #include <pwd.h>
  18. #include <sys/file.h>
  19. #ifdef BSD2_10
  20. #include <short_names.h>
  21. #endif /* BSD2_10 */
  22.  
  23. #include "nntp.h"
  24.  
  25. #ifdef SYSLOG
  26. # ifdef FAKESYSLOG
  27. #  include "fakesyslog.h"
  28. # else
  29. #  include <syslog.h>
  30. # endif
  31. #endif
  32.  
  33. #ifdef USG
  34. extern struct passwd *getpwent(), *getpwuid(), *getpwnam();
  35. #define iolen_t unsigned
  36. # include <string.h>
  37. #else /* not USG */
  38. # include <strings.h>
  39. # include <sys/wait.h>
  40. #define iolen_t int
  41. #endif /* not USG */
  42.  
  43. #ifdef DIRENT
  44. #include <dirent.h>
  45. #else
  46. # ifdef NDIR
  47. # ifdef M_XENIX
  48. #  include <sys/ndir.h>
  49. # else
  50. #  include <ndir.h>
  51. # endif
  52. # else /* not NDIR */
  53. #  include <sys/dir.h>
  54. # endif /* not NDIR */
  55. #endif /* not DIRENT */
  56.  
  57. #ifdef FCNTL
  58. # include <fcntl.h>
  59. #endif /* FCNTL */
  60.  
  61. #ifdef ultrix
  62. extern char * index();
  63. extern char * rindex();
  64. #endif
  65.  
  66. /*
  67.  * <dbm.h> stupidly defines NULL, which is why the following
  68.  * brain death is necessary.
  69.  */
  70.  
  71. #ifdef DBM
  72. # ifdef DBZ
  73. #  include <dbz.h>
  74. # else /* DBZ */
  75. #  undef NULL
  76. #  include <dbm.h>
  77. #  undef NULL
  78. #  define NULL    0
  79. # endif /* DBZ */
  80. #else
  81. # ifdef NDBM
  82. #  include <ndbm.h>
  83. # endif /* NDBM */
  84. #endif /* DBM */
  85.  
  86. #ifdef TIMEOUT
  87. #ifdef    USG
  88. #include <sys/time.h>
  89. #if !defined(SVR4) && !defined(hpux)
  90. typedef    struct { int fds_bits[1]; }    fd_set;
  91. #endif
  92. #endif
  93. #ifndef TIMERS
  94. #define TIMERS
  95. #endif
  96. #endif
  97.  
  98. #ifdef LOGINCHECK
  99. #ifndef TIMERS
  100. #define TIMERS
  101. #endif
  102. #endif
  103.  
  104. #ifdef BATCHCHECK
  105. #ifndef TIMERS
  106. #define TIMERS
  107. #endif
  108. #endif
  109.  
  110. /*
  111.  * Some generic maximums.
  112.  */
  113.  
  114. #ifndef MAXPATHLEN
  115. #define    MAXPATHLEN    1024
  116. #endif
  117.  
  118. #ifndef MAXHOSTNAMELEN
  119. #define    MAXHOSTNAMELEN    256
  120. #endif
  121.  
  122. #ifndef MINFREE
  123. #define MINFREE         0
  124. #endif
  125.  
  126. #ifndef POSTBUFFER
  127. #define POSTBUFFER      0
  128. #endif
  129.  
  130. #define    MAXBUFLEN    1024
  131.  
  132. /*
  133.  * For "spew()"
  134.  */
  135.  
  136. #define    ARTICLE    0
  137. #define    HEAD    1
  138. #define    BODY    2
  139. #define    STAT    3
  140.  
  141. /*
  142.  * For "ngmatch()"
  143.  */
  144.  
  145. #define    ALLBUT    1
  146.  
  147. #define    valid_art(s)    (atoi(s) != 0)
  148.  
  149. #define    putline(s)    fputs((s), stdout); putchar('\r'); putchar('\n');
  150.  
  151. extern    int    errno;
  152.  
  153. extern    char    *gets(), *fgets();
  154. extern    char    *mktemp();
  155. extern    FILE    *open_valid_art();
  156. extern    FILE    *openartbyid();
  157. extern    char    *gethistent();
  158. extern    int    restreql();
  159. extern    int    s1strneql();    /* for ngmatch */
  160. #ifdef DEBUG
  161. void debugup(), debugdown();
  162. #endif
  163. #ifdef SETPROCTITLE
  164. void setproctitle();
  165. #endif
  166.  
  167. extern    char    spooldir[];
  168. extern    char    activefile[];
  169. extern    char    distributionsfile[];
  170. extern    char    subscriptionsfile[];
  171. extern    char    newsgroupsfile[];
  172. extern    char    accessfile[];
  173. extern    char    historyfile[];
  174. extern    char    overviewfmtfile[];
  175. extern    char    activetimesfile[];
  176. extern    char    inews[];
  177. extern    char    rnews[];
  178.  
  179. #ifdef    XTHREAD
  180. extern    char    threaddir[];
  181. extern    char    *threadfile;
  182. #endif
  183.  
  184. extern    char    **group_array;
  185. extern    char    *actbuf;
  186. extern    int    num_groups;
  187. extern    char    *homedir;
  188. extern    int    ingroup;
  189. extern    char    *group_name;
  190. extern    long    group_artnum;
  191. extern    int    maxgroups;
  192. #ifdef DYNAMIC_ART_ARRAY
  193. extern    int    *art_array;
  194. extern    unsigned int size_art_array;
  195. #else
  196. extern    int    art_array[];
  197. #endif
  198. extern    int    art_ptr;
  199. extern    FILE    *art_fp;
  200. extern    int    num_arts;
  201. extern    int    uid_poster, gid_poster;
  202. extern    char    *home_poster;
  203. extern    int    canread, canpost, canxfer;
  204. extern    char    **ngpermlist;
  205. extern    int    ngpermcount;
  206.  
  207. extern    char    nntp_version[];
  208.  
  209. extern    char    hostname[];
  210. extern    int    debug;
  211.  
  212. #ifdef LOG
  213. extern    int    grps_acsd, arts_acsd;
  214.  
  215. extern    int    ih_accepted;
  216. extern    int    ih_rejected;
  217. extern    int    ih_failed;
  218.  
  219. extern    int    nn_told;
  220. extern    int    nn_took;
  221. #endif
  222.